public class Draw {

    public void drawTriangle(int height) {
        for (int i = 1; i <= height; i++) {
            for (int j = i; j < height; j++) {
                System.out.print(" ");
            }
            for (int p = 0; p < 2 * i - 1; p++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public void drawRectangle(int length, int height) {
        for (int i = 0; i < height; i++) {
            for (int j = 0; j < length; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public void drawSquare(int side) {
        drawRectangle(side, side);
    }

    public void drawParallelogramAttempt(int base, int height) {
        for (int i = 0; i < height; i++) {
            for (int j = 0; j < i; j++) {
                System.out.print(" ");
            }
            for (int k = 0; k < base; k++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public void drawRightAlignedParallelogram(int base, int height) {
        for (int i = 0; i < height; i++) {
            for (int j = 0; j < height - i - 1; j++) {
                System.out.print(" ");
            }
            for (int k = 0; k < base; k++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Draw draw1 = new Draw();

        System.out.println("Triangle:");
        draw1.drawTriangle(5);

        System.out.println("\nRectangle:");
        draw1.drawRectangle(4, 5);

        System.out.println("\nSquare:");
        draw1.drawSquare(4);

        System.out.println("\nParallelogram:");
        draw1.drawParallelogramAttempt(5, 6);
    }
}